﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using DiscoveryLogic.DataServices.DataSources;

namespace DiscoveryLogic.UI.Layouts.DataAccesses
{
    public class MortgageManager
    {
         
        private static MortgageAccount mortgageAccount= null;

        private static MortgageAccount WSMortgage
        {
            get
            {
                MortgageService mortgageService = new MortgageService();
                return MortgageService.Account ;                 
            }
        }

        private static MortgageAccount LocalMortgage
        {
            get
            {
                MortgageAccount m = new MortgageAccount(1, "abc1234", AccountType.Mortgage, 125000, 900, DateTime.Today.Add(TimeSpan.FromDays(27)), 3000, 4.9, 0, 600, 600,
                    new DateTime(DateTime.Today.Year + 1, 4, 1), null, 82092);
                m.PaymentSchedule = new AmortizationSchedule();
                m.PaymentSchedule.TotalPayments = 360;
                m.PaymentSchedule.StartDate = new DateTime(DateTime.Today.Year - 5, 6, 1);
                m.ProjectedPaymentCompleteDate = new DateTime(DateTime.Today.Year + 15, 6, 1);
                
                return m;
                //return LocalDataFiles.LoadData<MortgageAccount>("DiscoveryLogic.UI.Layouts.LocalDataFiles.Mortgage.xml");
            }
        }

       /* 
  
        */ 
        public static MortgageAccount GetMortgage(int id)
        {
            if (((App)Application.Current).UseWebServices)
                mortgageAccount = WSMortgage;
            else
                mortgageAccount = LocalMortgage;

            return mortgageAccount;

        }

    }
}
